<?php

namespace app\log;

use think\facade\Log;

class CountReqTime
{
    //执行Mysql次数
    static $execMysqlNum = 0;

    static $execMysqlTotalTime = 0;

    //执行Mongo次数
    static $execMongoNum = 0;

    static $execMongoTotalTime = 0;

    //执行curl请求次数
    static $execCurlNum = 0;

    static $execCurlTotalTime = 0;

    /**
     * @desc 设置执行次数统计
     */
    public static function setLogCount()
    {
        $data = [
            "exec_mysql_num" =>  self::$execMysqlNum,
            "exec_mysql_num_total_time" =>  self::$execMysqlTotalTime,
            "exec_mongo_num" =>  self::$execMongoNum,
            "exec_mongo_num_total_time" =>  self::$execMongoTotalTime,
            "exec_curl_num" =>  self::$execCurlNum,
            "exec_curl_num_total_time" =>  self::$execCurlTotalTime,
        ];

        UserLog::Info("执行次数统计", $data);
    }
}